package com.xneure.database.dao;

import java.util.List;

public class Paging {
	private int pageNum;
	private int pageSize;
	private long total = -1;
	private int pages;
	private List<?> result;

	public Paging(int pageNum, int pageSize) {
		this.pageNum = pageNum;
		this.pageSize = pageSize;
	}

	@SuppressWarnings("unchecked")
	public <T> List<T> getResult() {
		return (List<T>) result;
	}

	public void setResult(List<?> result) {
		this.result = result;
	}

	public int getPages() {
		return pages;
	}

	public void setPages(int pages) {
		this.pages = pages;
	}

	public int getPageNum() {
		return pageNum;
	}

	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	@Override
	public String toString() {
		return "Page{" + "pageNum=" + pageNum + ", pageSize=" + pageSize + ", total=" + total + ", pages=" + pages + '}';
	}
}
